﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" py:layout="load('../layout.html')">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Wiki</title>
		
		<!-- Skin CSS file -->
		<link rel="stylesheet" type="text/css" href="/yui/build/assets/skins/sam/skin.css" />
		<!-- Utility Dependencies -->
		<script type="text/javascript" src="/yui/build/yahoo-dom-event/yahoo-dom-event.js"></script> 
		<script type="text/javascript" src="/yui/build/element/element-beta-min.js"></script> 
		<!-- Needed for Menus, Buttons and Overlays used in the Toolbar -->
		<script src="/yui/build/container/container_core-min.js"></script>
		<script src="/yui/build/menu/menu-min.js"></script>
		<script src="/yui/build/button/button-min.js"></script>
		<!-- Source file for Rich Text Editor-->
		<script src="/yui/build/editor/editor-min.js"></script>

        <script type="text/javascript">

        window.onload = function() {
			var myEditor = new YAHOO.widget.Editor('body', { 
				height: '300px', 
			    width: '100%', 
				dompath: true, //Turns on the bar at the bottom 
				animate: true, //Animates the opening, closing and moving of Editor windows 
				collapse: true,
				toolbar: {
					// titlebar: 'Text Editing Tools',
					draggable: true,
					buttonType: 'advanced',
					buttons: [
						/* { group: 'fontstyle', label: 'Font Name and Size',
							buttons: [
								{ type: 'select', label: 'Arial', value: 'fontname', disabled: true,
									menu: [
										{ text: 'Arial', checked: true },
										{ text: 'Arial Black' },
										{ text: 'Comic Sans MS' },
										{ text: 'Courier New' },
										{ text: 'Lucida Console' },
										{ text: 'Tahoma' },
										{ text: 'Times New Roman' },
										{ text: 'Trebuchet MS' },
										{ text: 'Verdana' }
									]
								},
								{ type: 'spin', label: '13', value: 'fontsize', range: [ 9, 75 ], disabled: true }
							]
						},
						{ type: 'separator' }, */
						{ group: 'textstyle', label: 'Font Style',
							buttons: [
								{ type: 'push', label: 'Bold CTRL + SHIFT + B', value: 'bold' },
								{ type: 'push', label: 'Italic CTRL + SHIFT + I', value: 'italic' },
								{ type: 'push', label: 'Underline CTRL + SHIFT + U', value: 'underline' },
								{ type: 'separator' },
								{ type: 'push', label: 'Subscript', value: 'subscript', disabled: true },
								{ type: 'push', label: 'Superscript', value: 'superscript', disabled: true },
								{ type: 'separator' },
								/* { type: 'color', label: 'Font Color', value: 'forecolor', disabled: true },
								{ type: 'color', label: 'Background Color', value: 'backcolor', disabled: true },
								{ type: 'separator' }, */
								{ type: 'push', label: 'Remove Formatting', value: 'removeformat', disabled: true },
								{ type: 'push', label: 'Show/Hide Hidden Elements', value: 'hiddenelements' }
							]
						},
						{ type: 'separator' },
						{ group: 'alignment', label: 'Alignment',
							buttons: [
								{ type: 'push', label: 'Align Left CTRL + SHIFT + [', value: 'justifyleft' },
								{ type: 'push', label: 'Align Center CTRL + SHIFT + |', value: 'justifycenter' },
								{ type: 'push', label: 'Align Right CTRL + SHIFT + ]', value: 'justifyright' },
								{ type: 'push', label: 'Justify', value: 'justifyfull' }
							]
						},
						{ type: 'separator' },
						{ group: 'parastyle', label: 'Paragraph Style',
							buttons: [
							{ type: 'select', label: 'Normal', value: 'heading', disabled: true,
								menu: [
								    { text: 'Normal', value: 'none', checked: true },
									// { text: 'Paragraph', value: 'p', checked: true },
									{ text: 'Header 1', value: 'h1' },
									{ text: 'Header 2', value: 'h2' },
									{ text: 'Header 3', value: 'h3' },
									{ text: 'Header 4', value: 'h4' },
									{ text: 'Header 5', value: 'h5' },
									{ text: 'Header 6', value: 'h6' }
								]
							}
							]
						},
						{ type: 'separator' },
						{ group: 'indentlist', label: 'Lists',
							buttons: [
								{ type: 'push', label: 'Indent', value: 'indent', disabled: true },
								{ type: 'push', label: 'Outdent', value: 'outdent', disabled: true },
								{ type: 'push', label: 'Create an Unordered List', value: 'insertunorderedlist' },
								{ type: 'push', label: 'Create an Ordered List', value: 'insertorderedlist' }
							]
						},
						{ type: 'separator' },
						{ group: 'insertitem', label: 'Insert Item',
							buttons: [
								{ type: 'push', label: 'HTML Link CTRL + SHIFT + L', value: 'createlink', disabled: true },
								{ type: 'push', label: 'Insert Image', value: 'insertimage' }
							]
						}
					]
				},
				handleSubmit: true
			}); 
			myEditor.render(); 
		}
				
        </script>
		<style>
			#title {
				width: 100%;
				font-size: 24px;
				font-weight: bold;
			}
		</style>
		
    </head>
    <body>
        <form action="commit" method="post">
            <div>
                <input type="text" name="title" id="title" value="$c.entry.title" />
				<br />
            </div>
            <div>
                <textarea name="body" id="body" rows="10" cols="80" py:content="c.entry.body">
                </textarea>
            </div>
            <br/>
            <input type="hidden" name="path" value="$c.entry.path"  />
            <input type="submit" value="submit" />
        </form>
    </body>
</html>
